import { defineStore } from "pinia";

const infoArray: (
  | {
      num: never;
      receiverIdNo: string;
      receiverName: any;
      receiverPhone: any;
      companyNo: any;
      customerIdNo: string;
      orderId: any;
      goodsName: any;
      ssogId: any;
      ispicked: boolean;
      remarks: string;
    }
  | undefined
)[] = [];

const pickStore = defineStore("picker", {
  // 持久化存储插件其他配置
  state: () => ({
    pickerInfo: {
      receiverName: "", // 姓名
      receiverPhone: "", // 手机号
      receiverIdNo: "", // 身份证
      remarks: "", // 备注
      inputValues: [], // 货物数量
    },
    // pickerData:[], // 交货接口的信息
    pickerData: infoArray,
  }),

  actions: {
    restPickerInfo() {
      this.pickerInfo = {
        receiverName: "", // 姓名
        receiverPhone: "", // 手机号
        receiverIdNo: "", // 身份证
        remarks: "", // 备注
        inputValues: [], // 货物数量
        fileList: [], // 上传的图片
      };
      this.pickerData = infoArray; // 交货接口的信息
    },
  },

  getters: {},
});

export default pickStore;
